package entry42.pre;

import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;

import org.junit.Test;

public class Length {
	public int intLength(int... array) {
		return array.length;
	}

	public int objLength(Object... array) {
		return array.length;
	}

	public <T> int genericLength(T... ts) {
		return ts.length;
	}

	@Test
	public void testLength() {
		assertThat(genericLength(1, 2, 3), is(3));
	}
	
//	@Test
	public void testLength2() {
		int[] intArray = { 1, 2, 3 };
		Integer[] integerArray = { 1, 2, 3 };
		Integer[] integerArray2 = { 1, 2, 3 };
		Object[] objectArray = { 1, 2, 3 };

		assertThat(intLength(intArray), is(3));
//		assertThat(objLength(intArray), is(3));
		assertThat(genericLength(integerArray), is(2));
//		assertThat(this.<Integer>genericLength(integerArray), is(3));
//		assertThat(objLength(objectArray), is(3));
	}
}
